Function Reference

_GUICtrlEditEmptyUndoBuffer

Resets the undo flag of an edit control.

#Include <GuiEdit.au3>
_GUICtrlEditEmptyUndoBuffer($h_edit)

 

Parameters

$h_edit control id/control hWnd

 

Return Value

None.

 

Remarks

The undo flag is automatically reset whenever the edit control receives a WM_SETTEXT or EM_SETHANDLE message.
The control can only undo or redo the most recent operation.

 

Related

_GUICtrlEditCanUndo, _GUICtrlEditGetModify, _GUICtrlEditReplaceSel, _GUICtrlEditSetModify, _GUICtrlEditUndo

 

Example


#include <GUIConstants.au3>
#include <GuiEdit.au3>

opt('MustDeclareVars', 1)

Dim $myedit, $ret, $Status, $msg, $current, $Btn_Empty

GUICreate("Edit Empty Undo Buffer", 392, 254)

$myedit = GUICtrlCreateEdit("First line" & @CRLF, 140, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL)
$Btn_Empty = GUICtrlCreateButton("Emtpy Buffer", 150, 150)
$Status = GUICtrlCreateLabel("Nothing to Undo", 0, 234, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))

GUISetState()

; Run the GUI until the dialog is closed
While 1
   $msg = GUIGetMsg()
   $ret = _GUICtrlEditCanUndo ($myedit)
   If ($ret <> $current) Then
      If ($ret == 0) Then
         GUICtrlSetData($Status, "Nothing to Undo")
      Else
         GUICtrlSetData($Status, "Undo Available")
      EndIf
      $current = $ret
   EndIf
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case $msg = $Btn_Empty
         _GUICtrlEditEmptyUndoBuffer ($myedit)
   EndSelect
WEnd